<template>
  <van-tabbar v-model="flag" active-color="#f44336" inactive-color="#000">
  <van-tabbar-item icon="home-o" replace to="/home">首页</van-tabbar-item>
  <van-tabbar-item icon="label-o" replace to="/subject">专题</van-tabbar-item>
  <van-tabbar-item icon="apps-o" replace to="/classification">分类</van-tabbar-item>
  <van-tabbar-item icon="chat-o" replace to="/cart">购物车</van-tabbar-item>
  <van-tabbar-item icon="contact" replace to="/user">我的</van-tabbar-item>
</van-tabbar>
</template>

<script>
import Vue from 'vue';
import { Tabbar, TabbarItem } from 'vant';

Vue.use(Tabbar);
Vue.use(TabbarItem);
export default {
    name:'Tabbar',
    data() {
        return {
            flag:0
        }
    },
    mounted() {
        this.$bus.$on('changeFlag',(flag)=>{
            this.flag = flag
        })
    },
}
</script>

<style lang="less" scoped>
</style>